{% extends 'PortalMainBundle::layout.html.twig' %}

{% block stylesheets %}
  {{ parent() }}
{% endblock %}
{% block javascripts %}
  {{ parent() }}
<script>
    function validate(form) {
        var valid = true;

        // validation code here ...

        if (!valid)
            return false;
        else
            return confirm('Та хичээлийн хуваарь үүсгэхдээ итгэлтэй байна уу?');
    }
    </script>
{% endblock %}
{% block content %}
{% include 'PortalMainBundle::Breadcrumbs/breadcrumbs.html.twig' with {'breadcrumbTitle':mail.EMAIL, 'breadcrumbDetail': '<b>Хичээл заалгах хүсэлт</b> : '~mail.TITLE} %}     

    <div>

        <div>
      {{mail.BODY}}
            </div>
    {% if is_granted('ROLE_TUTOR') %} 
            <hr/> 



            <div class="topSpace row-fluid">
                <div class="accordion" id="accordion899"><div class="accordion-group">
                        <div class="accordion-heading">
                            <a data-toggle="collapse" href="#collapse152" class="accordion-toggle collapsed" data-parent="#accordion899"><span class="entypo plus metaIcon"><i></i></span><i></i>Хичээл үүсгэх</a>
                        </div>
                        <div style="height: 0px;" class="accordion-body collapse" id="collapse152">
                            <div class="accordion-inner">
                                
                             <form action="{{path('createLesson')}}" method="post" {{ form_enctype(lessonForm) }} autocomplete="off" onsubmit="return validate(this);">
                                        <div>
                                            <div>{{ form_label(lessonForm.subjectCategory, 'Хичээлийн төрөл', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.subjectCategory, { 'id':'subjectCategory', 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>
                                        <div>
                                            <div>{{ form_label(lessonForm.subject, 'Хичээлийн нэр', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.subject, { 'id':'subject', 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>
                                        <div>
                                            <div>{{ form_label(lessonForm.startDate, 'Хичээл эхлэх огноо', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.startDate, { 'id':'subject', 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>
                                        <div>
                                            <div>{{ form_label(lessonForm.endDate, 'Хичээл дуусах огноо', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.endDate, { 'id':'subject', 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>
                                        <div>
                                            <div>{{ form_label(lessonForm.totalHours, 'Нийт заах хичээлийн цаг', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.totalHours, { 'id':'subject', 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>
                                        <div>
                                            <div>{{ form_label(lessonForm.hourlyFee, 'Нэг цагийн хөлс', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.hourlyFee, { 'id':'subjectCategory', 'value' : tutorCurrentFee, 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>
                                        <div>
                                            <div>{{ form_label(lessonForm.address, 'Хичээл заах хаяг', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.address, { 'id':'subjectCategory', 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>
                                        <div>
                                            <div>{{ form_label(lessonForm.description, 'Нэмэлт тэмдэглэл', { 'label_attr': { 'class': 'control-label' } }) }}</div>
                                            <div>{{ form_widget(lessonForm.description, { 'id':'subjectCategory', 'attr': {'class': 'span12', 'onChange':'changeTitle(this)'} }) }}</div>
                                        </div>

                                        <div>
        {{ form_widget(lessonForm._token) }}
                                                <input type="hidden" name="messageId" value="{{mail.ID}}">                                                
                                                <input type="submit" class="btn btn-success" value="Үүсгэх">
                                            </div>

                                        </form>
                                
                            
                            </div>
                        </div>
                    </div>   
                 </div>
            </div>


    {% endif %}


            </div>

{% endblock %}